<template>
  <shop-card v-if="list" :price="list.price" :img-src="list['img-src']" :id="id">
    <template #link>{{ list.title }}</template>
    <template #body>{{ list.body }}</template>
  </shop-card>
</template>

<script setup lang="ts">
import ShopCard from "../components/ShopCard.vue"
import { getJSON } from "../network/main"
import { useStore } from "../store/main"
import { computed, ref } from "vue"
import { useRoute } from "vue-router"
const store = useStore()
const route = useRoute()
const id = ref(Number(route.params.shopId))
const list = computed(() => store.state.goods[id.value - 1])
getJSON(store)
</script>
<script lang="ts">
export default {
  name: "Shops"
}
</script>
<style scoped>

</style>